<?php
class CMRPageTest extends CMRPage
{
protected function getContentsDiv()
	{
		$html = "<div id=\"content\">\n";
		$html .= "<h1>Test Page</h1>";

		$sectionsPanel = new SectionsPanel('');
		$html .= $sectionsPanel->getHTML();

		
//		echo $this->getSubAction();
//   For Repertoire items
/*		$sql = "SELECT ResourceID from Resources WHERE ResourceTypeID=2";
		$this->Database->ExecuteSQL($sql);
		$resources = array();
		while($row=$this->Database->getRow())
		{
			$database=$this->Database->Recopy();
			$resource = new ResourceRepertoireInfo($database,$row['ResourceID']);
			array_push($resources,$resource);
		}
		
		foreach ($resources as $resource) 
		{
			$composer = new ResourceComposer($this->Database->Recopy(),0);
			$composer->loadComposer($resource->getComposerID());
			
			$firstnameandinitials = trim($composer->getFirstName().' '.$composer->getSecondNames());
			
			$title = $composer->getSurname().' ('.$firstnameandinitials.') - '.$resource->getTitle();
			
			$description = 'Repertoire information for '.$resource->getTitle().' by '.$composer->getFirstName(). ' '.$composer->getSecondNames().' '.$composer->getSurname();
			
			$keywords =  $composer->getSurname().' '.$resource->getTitle();
			
			$html .= "<p>".$title."<br>".$description."<br>".$keywords."</p>";
			
			$sql="UPDATE Resources SET ResourceTitle='".$title."', ResourceDescription='".$description."', ResourceKeywords='".$keywords."' WHERE ResourceID='".$resource->getResourceID()."'";
			$html .= "<p>".$sql."</p>\n";
			$this->Database->ExecuteSQL($sql);
			
		}
	
		$html .= "</div>\n";
		return $html;
		
*/
 /*
 // For Composers
  		$sql = "SELECT ResourceID from Resources WHERE ResourceTypeID=3";
		$this->Database->ExecuteSQL($sql);
		$resources = array();
		while($row=$this->Database->getRow())
		{
			$database=$this->Database->Recopy();
			$resource = new ResourceComposer($database,$row['ResourceID']);
			array_push($resources,$resource);
		}
		
		foreach ($resources as $resource) 
		{

			$firstnameandinitials = trim($resource->getFirstName().' '.$resource->getSecondNames());
			
			$title = $resource->getSurname().' ('.$firstnameandinitials.')';
			
			$description = 'Composer information for '.$resource->getFirstName();
			if($resource->getSecondNames()!="") $description .= ' '.$resource->getSecondNames();
			$description .= ' '.$resource->getSurname();
			
			$keywords =  $resource->getSurname();
						
			$html .= "<p>".$title."<br>".$description."<br>".$keywords."</p>";
			
			$sql="UPDATE Resources SET ResourceTitle='".$title."', ResourceDescription='".$description."', ResourceKeywords='".$keywords."' WHERE ResourceID='".$resource->getResourceID()."'";
			$html .= "<p>".$sql."</p>\n";
			$this->Database->ExecuteSQL($sql);
			
		}
	
		$html .= "</div>\n";
		return $html;
 */
 
	}
}
				
